package com.yunpeng.dishes.biz.services;

import com.yunpeng.dishes.common.dtos.business.DishesSaveDTO;
import com.yunpeng.dishes.common.dtos.business.OrderDishesSnapshotDTO;
import com.yunpeng.dishes.common.vo.DishesNutrientsVO;
import com.yunpeng.dishes.common.vo.OrderNutrientsVO;

import java.util.List;

/**
 * IDishesNutrientsService
 *
 * @author : Moore(hemw)
 * @date : 2020-03-26
 */
public interface IDishesNutrientsService {

    /**
     * 获取指定菜品菜品营养表数据
     *
     * @param code
     * @return
     */
    DishesNutrientsVO queryNutrientsOfDishesByCode(String code);

    /**
     * 获取商家菜品菜品营养表数据
     *
     * @param relationId
     * @return
     */
    DishesNutrientsVO queryNutrientsOfDishesById(Long relationId);

    /**
     * 根据名称获取10条（最多）参考菜品营养成分表
     *
     * @param name
     * @return
     */
    List<DishesNutrientsVO> queryReferenceDishesListByName(String name);

    /**
     * 保存商户菜品数据
     *
     * @param dishesSaveDTO
     * @return
     */
    Boolean saveDishesFoodRelation(DishesSaveDTO dishesSaveDTO);

    /**
     * 转成菜品模板
     *
     * @param code
     * @param user
     */
    void copyToDishesTemplate(String code, Long user);

    /**
     * 保存订单菜品营养成分表快照
     *
     * @param orderDishesSnapshotDto
     */
    void saveOrderNutrientsSnapshot(OrderDishesSnapshotDTO orderDishesSnapshotDto);

    /**
     * 根据订单id获取订单快照数据
     *
     * @param orderId
     * @return
     */
    OrderNutrientsVO queryOrderNutrients(Long orderId);
}
